package com.trkj.dao.jpa;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.CcPrepayment;

public interface CcPrepaymentDAO extends CrudRepository<CcPrepayment,Long>{

	@Query("select cp from CcPrepayment cp where "
			+ "cp.ppstatc='正常'")
	public List<CcPrepayment> findByppremarks1();
	
	@Query("select cp from CcPrepayment cp where cp.ppatientno=?1")
	public CcPrepayment findBypatient(BigDecimal ppatientno);
	
	@Query("select cp from CcPrepayment cp where cp.ppmoney<?1")
	public List<CcPrepayment> findByppmoney(Pageable pageable,BigDecimal ppmoney);
	@Query("select count(*) from CcPrepayment cp where cp.ppmoney<?1")
	public long countByppmoney(BigDecimal ppmoney);

}
